package lab.gene.action;

import java.util.Date;

import com.opensymphony.xwork2.ActionSupport;

import lab.gene.pojo.GeneMinipre;

import lab.gene.service.impl.GeneMinipreServiceImpl;

public class ViewGeneMinipreAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Date recordDate = null;
	private int colony;
	private float ml;
	private String seqConfirmed = null;
	private String comments = null;
	private String geneName = null;
	private String type = null;
	
	public String execute() {
		String result = null;
		System.out.println("ViewMiniPreAction");
		GeneMinipreServiceImpl service = new GeneMinipreServiceImpl();
		GeneMinipre gmnp = null;
		gmnp = service.getGeneMinipreByNameAndType(geneName, type);
		if (gmnp != null) {
			recordDate = gmnp.getRecordDate();
			colony = gmnp.getColony();
			ml = gmnp.getMl();
			seqConfirmed = gmnp.getSeqConfirmed();
			comments = gmnp.getComments();
		}
		switch (type) {
		case "A":
			result = "successA";
			break;
		case "B":
			result = "successB";
			break;
		case "C":
			result = "successC";
			break;
		case "D":
			result = "successD";
			break;
		}
		System.out.println("returninig");
		return result;
	}
	public Date getRecordDate() {
		return recordDate;
	}
	public void setRecordDate(Date recordDate) {
		this.recordDate = recordDate;
	}
	public int getColony() {
		return colony;
	}
	public void setColony(int colony) {
		this.colony = colony;
	}
	public float getMl() {
		return ml;
	}
	public void setMl(float ml) {
		this.ml = ml;
	}
	public String getSeqConfirmed() {
		return seqConfirmed;
	}
	public void setSeqConfirmed(String seqConfirmed) {
		this.seqConfirmed = seqConfirmed;
	}
	public String getComments() {
		return comments;
	}
	public void setComments(String comments) {
		this.comments = comments;
	}
	public String getGeneName() {
		return geneName;
	}
	public void setGeneName(String geneName) {
		this.geneName = geneName;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}

}
